/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gen.seam.generator.template;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Gustavo
 */
public class TemplateFactory {

    public static <T extends Template> T get(Class<T> clazz) {
        Template type = null;
        try {
            type = (T) clazz.newInstance();
        } catch (InstantiationException ex) {
            Logger.getLogger(TemplateFactory.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(TemplateFactory.class.getName()).log(Level.SEVERE, null, ex);
        }
        return (T) type;
    }
}
